﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPageLayout.master" AutoEventWireup="true" CodeBehind="frmLopMonhoc.aspx.cs" Inherits="BVVD_Website.ql_hoc_tap.frmLopMonhoc" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        div.RadListBox .rlbGroup {
            overflow: auto;
        }

        .rsbHeader ul,
        .rsbListItem ul {
            margin: 0;
            padding: 0;
            width: 100%;
            display: inline-block;
            list-style-type: none;
        }

        .rsbHeader ul {
            padding-left: 5px;
        }

        .col1,
        .col2,
        .col3 {
            margin: 0;
            padding: 0 5px 0 0;
            width: 110px;
            line-height: 14px;
            float: left;
        }


        html .rsbSlide,
        html .rsbDropDownSlide {
            z-index: 90002;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
    <div id="Div1" class="mpBottomContent" runat="server">
        <asp:Label runat="server" ID="lblMenu" Style="margin: 0 auto 0 auto; font-family: 'Microsoft Sans Serif'; font-size: larger; color: forestgreen" Text="Danh sách lớp học-môn học"></asp:Label>

        <table style="margin: 0 auto 0 auto; border: 5px thin red; width: 90% !important; padding: 5px 5px 5px 5px">
            <caption style="float: left">
                <telerik:RadDropDownList DefaultMessage="Chọn lớp" OnSelectedIndexChanged="ddlLOPHOC_SelectedIndexChanged" AutoPostBack="true" runat="server" ID="ddlLOPHOC"></telerik:RadDropDownList>

            </caption>
            <tr>
                <td>
                    <telerik:RadGrid ID="grvLopMonhoc" Skin="Hay" AllowFilteringByColumn="true" MasterTableView-NoMasterRecordsText="Không tìm thấy bản ghi nào" MasterTableView-ShowHeadersWhenNoRecords="true" ClientSettings-ColumnsReorderMethod="Reorder" ClientSettings-AllowColumnsReorder="true" ClientSettings-Animation-AllowColumnReorderAnimation="true" ClientSettings-Animation-ColumnReorderAnimationDuration="300" PageSize="15" AllowSorting="true" ShowGroupPanel="true" AutoGenerateColumns="false" AllowPaging="true" ClientSettings-AllowDragToGroup="true" runat="server" OnNeedDataSource="grvLopMonhoc_NeedDataSource" OnItemDataBound="grvLopMonhoc_ItemDataBound" OnDeleteCommand="grvLopMonhoc_DeleteCommand" OnInsertCommand="grvLopMonhoc_InsertCommand">

                        <PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="RadComboBox" Wrap="true" AlwaysVisible="true" />

                        <MasterTableView CommandItemDisplay="Top" EnableNoRecordsTemplate="true" CssClass="MasterClass" ShowFooter="true" EditMode="PopUp" Summary="SUMMARY" ShowHeadersWhenNoRecords="true"
                            DataKeyNames="RECID">
                            <CommandItemSettings ExportToPdfText="Xuất file dạng PDF" ShowExportToPdfButton="true"></CommandItemSettings>
                            <CommandItemSettings ExportToExcelText="XUất file dạng Excel" ShowExportToExcelButton="true"></CommandItemSettings>

                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

                            <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column" Created="True"></ExpandCollapseColumn>
                            <NoRecordsTemplate>
                                <div>
                                    Không có bản ghi nào
                                </div>
                            </NoRecordsTemplate>
                            <Columns>

                                <telerik:GridBoundColumn UniqueName="RECID" EditFormColumnIndex="1" Display="false" ReadOnly="true" HeaderText="" DataField="RECID">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                    <HeaderStyle ForeColor="Silver" Width="20px"></HeaderStyle>
                                    <ItemStyle ForeColor="Gray"></ItemStyle>
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn UniqueName="MALH" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã lớp" DataField="MALH">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>

                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="MAMH" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Mã môn học" DataField="MAMH">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>

                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn UniqueName="TRANGTHAI" FilterControlWidth="70%" HeaderStyle-Width="20%" HeaderText="Trạng thái" DataField="TRANGTHAI">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>


                                <telerik:GridBoundColumn UniqueName="GHICHU" FilterControlWidth="70%" Display="true" HeaderStyle-Width="30%" HeaderText="Ghi chú" DataField="GHICHU">
                                    <ColumnValidationSettings>
                                        <ModelErrorMessage Text=""></ModelErrorMessage>
                                    </ColumnValidationSettings>
                                </telerik:GridBoundColumn>

                                <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" HeaderText="Xóa" ItemStyle-Width="60" HeaderStyle-Width="60" ConfirmDialogType="RadWindow" ConfirmTextFormatString="Bạn chắc chắn muốn xóa bản ghi : \n\n \t Mã lớp học : {0} <br> \t Mã môn học :  {1} \n " ConfirmTextFields="MALH, MAMH" ConfirmTitle="Xác nhận xóa" ConfirmText="Xóa, Hủy" Text="Xóa" UniqueName="btnDelete">
                                </telerik:GridButtonColumn>
                            </Columns>
                            <EditFormSettings EditFormType="Template" PopUpSettings-ScrollBars="Both" PopUpSettings-ShowCaptionInEditForm="true" PopUpSettings-Width="600" PopUpSettings-Height="400" PopUpSettings-ZIndex="7000" InsertCaption="Thêm mới học viên vào lớp " PopUpSettings-Modal="true" CaptionFormatString="Mã lớp học {0}" CaptionDataField="MALH">
                                <FormTemplate>
                                    <div id="rfd-demo-zone" style="border: solid; border-color: whitesmoke; border-width: 5px; padding: 6px 6px 6px 6px;">
                                        <table width="500" height="400" border="0" cellspacing="10" cellpadding="10">
                                            <caption>
                                                <telerik:RadSearchBox ID="RadSearchBox1" DataSourceID="LinqDataSource1" DataTextField="NAME" Filter="Contains" OnSearch="RadSearchBox1_Search" EmptyMessage="Nhập tên/mã môn học để tìm kiếm" Width="300" CssClass="upAll" Skin="Hay" MinFilterLength="1" EnableAutoComplete="true" ShowSearchButton="true" runat="server"
                                                    MaxResultCount="20" DataValueField="MAMH" DataKeyNames="MAMH,TENMH">
                                                    <DropDownSettings Height="300">
                                                        <HeaderTemplate>
                                                            <ul>
                                                                <li class="col1">Mã môn học</li>
                                                                <li class="col2">Tên môn học</li>

                                                            </ul>
                                                        </HeaderTemplate>
                                                        <ItemTemplate>
                                                            <ul>
                                                                <li class="col1">
                                                                    <%# DataBinder.Eval(Container.DataItem, "MAMH") %>
                                                                </li>
                                                                <li class="col2">
                                                                    <%# DataBinder.Eval(Container.DataItem, "TENMH") %>
                                                                    
                                                                </li>

                                                            </ul>
                                                        </ItemTemplate>
                                                    </DropDownSettings>
                                                </telerik:RadSearchBox>
                                            </caption>
                                            <tr>
                                                <td>
                                                    <asp:Label runat="server" ID="lblTEXT"></asp:Label></td>
                                                <td></td>
                                            </tr>
                                            <tr>
                                                <td>Danh sách môn học
                                                </td>
                                                <td>
                                                    <asp:Label runat="server" ID="lblMAMH"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <telerik:RadListBox runat="server" Style="text-align: left !important" OnTransferring="lboxMONHOC_Transferring" TransferMode="Move" Height="200" Skin="Telerik" Width="250" Sort="Ascending" AllowTransferDuplicates="false" ID="lboxMONHOC" AllowTransfer="true" TransferToID="lboxTOLOP">
                                                    </telerik:RadListBox>
                                                </td>
                                                <td>
                                                    <telerik:RadListBox Height="200" Style="text-align: left !important" Skin="Telerik" Width="250" runat="server" ID="lboxTOLOP">
                                                    </telerik:RadListBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td></td>
                                                <td>
                                                    <asp:LinkButton ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Thêm mới" : "Cập nhật" %>'
                                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'></asp:LinkButton>&nbsp;
                                <asp:LinkButton ID="btnCancel" Text="Hủy" runat="server" CausesValidation="False"
                                    CommandName="Cancel"></asp:LinkButton></td>
                                            </tr>
                                        </table>
                                    </div>
                                </FormTemplate>
                            </EditFormSettings>
                        </MasterTableView>
                        <ClientSettings>
                            <ClientEvents OnPopUpShowing="PopUpShowing" />
                            <ClientEvents OnRowDblClick="RowDblClick" />
                            <Selecting AllowRowSelect="true" />
                            <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                            <Animation AllowColumnReorderAnimation="true" ColumnReorderAnimationDuration="500" />

                        </ClientSettings>
                        <ExportSettings Excel-Format="Biff" Pdf-DefaultFontFamily="Arial" FileName="Mydata" IgnorePaging="false" Excel-AutoFitImages="true" Excel-FileExtension="xls" HideStructureColumns="true"></ExportSettings>
                    </telerik:RadGrid>
                </td>
            </tr>
        </table>
    </div>

    <telerik:RadNotification ID="rnAlert" runat="server" Position="TopRight" EnableRoundedCorners="true"
        EnableShadow="true" Skin="Hay" Overlay="true" Animation="Fade" AnimationDuration="1000" Title="Thông báo">
    </telerik:RadNotification>
    <asp:LinqDataSource ID="LinqDataSource1" OnSelecting="LinqDataSource1_Selecting" runat="server" ContextTypeName="Business.BVVDDataContext" EntityTypeName=""  TableName="LST_MONHOCs"></asp:LinqDataSource>
</asp:Content>
